import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  { path: "/", redirect: "/filetree" },
  {
    path: "/",
    component: () => import("../views/Home/index.vue"),
    // 路由嵌套
    children: [
      {
        path: "/filetree",
        component: () => import("../views/FileTree/index.vue"),
      },
      {
        path: "/search",
        component: () => import("../views/Search/index.vue"),
      },
      {
        path: "/git",
        component: () => import("../views/Git/index.vue"),
      },

      {
        path: "/extends",
        component: () => import("../views/Extends/index.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
